using CSW.Framework.UI.Binding;
using CSW.Framework.UI.DevEx.Binding;
using CSW.Framework.UI.DevEx.Forms;
using CSW.Security;

namespace CSW.Security.UI.DevEx.Forms
{
    /// <summary>
    /// SecurityAppFunctionEditForm
    /// </summary>
    public partial class SecurityAppFunctionEditForm : DXBaseEditForm
    {
        private readonly EditFormBinder m_Binder;
        private readonly Security_AppFunction m_Security_AppFunction;

        /// <summary>
        /// Initializes a new instance of the <see cref="SecurityAppFunctionEditForm"/> class.
        /// </summary>
        /// <param name="security_AppFunction">The security_ app function.</param>
        public SecurityAppFunctionEditForm(Security_AppFunction security_AppFunction)
        {
            InitializeComponent();

            m_Security_AppFunction = security_AppFunction;

            m_Binder = new EditFormBinder(this, m_Security_AppFunction, dxError, btnSave, "App Function", RecordType.Parent, ShowErrors.AfterSave);
            m_Binder.Bind(new BindableTextEdit(txtAppFunctionID), "AppFunctionID");
            m_Binder.Bind(new BindableTextEdit(txtDescription), "Description");
            m_Binder.UpdateControls();
        }
    }
}